USE master
GO

CREATE TABLE smalldatetime_vu_prepare_table(c1 SMALLDATETIME)
GO

INSERT INTO smalldatetime_vu_prepare_table VALUES 
(CAST(10 as SMALLDATETIME)), 
(CAST(CAST (1 as BIT) as SMALLDATETIME)), 
(CAST(CAST (216.5937465072345996348935531215926 as NUMERIC(19,7)) as SMALLDATETIME)), 
(CAST(CAST (54.63493295443232 as FLOAT(12)) as SMALLDATETIME)), 
(CAST(CAST (3.1215926 as REAL) as SMALLDATETIME)), 
(CAST(CAST (98 as INT) as SMALLDATETIME)), 
(CAST(CAST (131.23 as BIGINT) as SMALLDATETIME)), 
(CAST(CAST (5 as SMALLINT) as SMALLDATETIME)), 
(CAST(CAST (9 as TINYINT) as SMALLDATETIME))
GO

CREATE PROCEDURE smalldatetime_vu_prepare_procedure 
AS
SELECT CAST(CAST (46.99999999 as MONEY) as SMALLDATETIME)
GO

CREATE FUNCTION dbo.smalldatetime_vu_prepare_function (@par SMALLMONEY)
RETURNS SMALLDATETIME AS
BEGIN
    Declare @res SMALLDATETIME
	SELECT @res = (SELECT CAST(@par AS SMALLDATETIME))
    RETURN  @res
END;
GO